package com.woniu.project.client;

import com.woniu.project.core.dto.ResultDto;
import com.woniu.project.params.product.ProductAddParam;
import com.woniu.project.params.product.ProductSelectParam;
import com.woniu.project.params.product.ProductUpdateParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@FeignClient(name = "product-server")
public interface ProductClient {
    //根据不同条件进行不同的分页查询
    @GetMapping("/pawn/product/product/select")
    public ResultDto select(@RequestBody ProductSelectParam productSelectParam) ;

    //新增商品类型
    @PostMapping("/pawn/product/product/addProduct")
    public ResultDto addProduct(@Valid @RequestBody ProductAddParam productAddParam) ;

    //修改商品类型
    @PutMapping("/pawn/product/product/updateProduct")
    public ResultDto updateProduct(@Valid @RequestBody ProductUpdateParam productUpdateParam);

    //根据id删除类型
    @DeleteMapping("/pawn/product/product/deleteById/{id}")
    public ResultDto deleteById(@PathVariable Integer id) ;
}
